package com.iran.factoryMethod.exampleLeiFeng;

public class Test {
    public static void main(String[] args) throws Exception {

        LeiFengFactory studentFactory = new StudentFactory();
        System.out.println(studentFactory.getClass().getName());
        //反射原理实现实例化对象
        //LeiFengFactory studentFactory = (LeiFengFactory) Class.forName("com.iran.factoryMethod.exampleLeiFeng.StudentFactory").newInstance();
        LeiFeng xiaomingLeiFeng = studentFactory.createLeiFeng();
        xiaomingLeiFeng.BuyRice();
        LeiFengFactory volunteerFactory =  new VolunteerFactory();
        LeiFeng yilangLeifeng = volunteerFactory.createLeiFeng();
        yilangLeifeng.Sweep();
    }
}
